<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include::header('承包方设置')"/>
</head>
<style>
    #febs-baseContractor .layui-table-click{
        background-color: #dbfbf0 !important;
    }
</style>
<body class="febs-container" id="febs-baseContractor">
    <div class="febs-body layui-fluid" lay-title="承包方设置">
        <div class="febs-body-search">
            <form class="layui-form layui-table-form" lay-filter="baseContractor-table-form" id="baseContractor-table-form">
                <div class="layui-card">
                    <div class="layui-card-body">
                        <div class="layui-form-item">
                            <div class="layui-inline" id="baseContractor-tenant" th:classappend="${hasHeadCompanyRole } ? '' : 'febs-hide'">
                                <label class="layui-form-label ">管理公司</label>
                                <div class="layui-input-inline" >
                                    <select name="tenantId" id="tenantId" lay-search="" >
                                        <option th:each="item:${tenantList }"
                                                th:value="${item.tenantId}" th:text="${item.tenantName}"
                                                th:selected="${tenantId ==item.tenantId}">
                                    </select>
                                </div>
                            </div>

                            <div class="layui-inline">
                                <label class="layui-form-label ">承包商名称</label>
                                <div class="layui-input-inline" style="width:190px;">
                                    <input type="text" name="contractorName" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label ">状态</label>
                                <div class="layui-input-inline" style="width:190px;">
                                    <select name="status" id="status">
                                        <option value="1">启用</option>
                                        <option value="0">禁用</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <div id="query" class="layui-btn">
                                    <em class="layui-icon">&#xe615;</em> 查询
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </form>
        </div>
        <div class="layui-row layui-col-space8" style="margin: 0 -4px;">
            <div class="layui-col-md6 febs-table-full" style="padding: 0px 4px 10px 4px">
                <table lay-filter="baseContractorTable" name="baseContractorTable"
                       lay-data="{id: 'baseContractorTable'}"></table>
            </div>
            <div class="layui-col-md6 febs-table-full" style="padding: 0px 4px 10px 4px">
                <table lay-filter="baseContractorTeamTable" name="baseContractorTeamTable"
                       lay-data="{id: 'baseContractorTeamTable'}"></table>
            </div>
        </div>
    </div>
<script type="text/html" id="baseContractor-toolbar">
    <div lay-event="add" shiro:hasPermission="baseContractor:add" class="layui-btn layui-btn-sm">
        <em class="layui-icon">&#xe654;</em> 新增承包商
    </div>
</script>
<script type="text/html" id="baseContractorTeam-toolbar">
    <div class="layui-form-item" style="margin-bottom: 0px">
        <div class="layui-inline">
            <label class="layui-form-label " style="width: auto;">承包队名称</label>
            <div class="layui-input-inline" style="width: 200px;">
                <input type="text" name="teamName" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-inline">
            <label class="layui-form-label " style="width: auto;">规则状态</label>
            <div class="layui-input-inline">
                <select name="teamStatus" id="teamStatus">
                    <option value="1">启用</option>
                    <option value="0">禁用</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <button id="ruleQuery" lay-event="teamQuery" type="button" class="layui-btn layui-btn-sm"
                    shiro:hasPermission="baseContractorTeam:view">
                <em class="layui-icon">&#xe615;</em> 查询
            </button>
        </div>
        <div class="layui-inline">
            <div lay-event="contractorTeamAdd" shiro:hasPermission="baseContractorTeam:add" class="layui-btn layui-btn-sm">
                <em class="layui-icon">&#xe654;</em> 新增承包队
            </div>
        </div>
    </div>
</script>

<th:block th:include="include::foot"/>
<script th:src="@{/febs/js/contractor/baseContractor/baseContractorList.js(v=1)}"></script>
<script type="text/html" id="baseContractor-option">
    <span shiro:lacksPermission="baseContractor:update,baseContractor:delete">
        <span class="layui-badge-dot febs-bg-orange"></span> 无权限
        </span>
    <button type="button" class="layui-btn layui-btn-xs layui-btn-primary layui-border-orange" lay-event="set" shiro:hasPermission="baseContractor:update">
         <i class="layui-icon layui-icon-set">设置</i>
    </button>
    <button type="button" class="layui-btn layui-btn-xs  layui-btn-primary layui-border-orange" lay-event="edit" shiro:hasPermission="baseContractor:update">
        <i class="layui-icon layui-icon-edit">编辑</i>
    </button>
    <button type="button" class="layui-btn layui-btn-xs  layui-btn-primary layui-border-red" lay-event="del" shiro:hasPermission="baseContractor:delete">
        <i class="layui-icon layui-icon-delete"></i>删除
    </button>
</script>

<script type="text/html" id="baseContractorTeam-option">
    <span shiro:lacksPermission="baseContractorTeam:update,baseContractorTeam:delete">
        <span class="layui-badge-dot febs-bg-orange"></span> 无权限
        </span>
    <button type="button" lay-event="edit" class="layui-btn layui-btn-xs  layui-btn-primary layui-border-orange" shiro:hasPermission="baseContractorTeam:update">
        <em class="layui-icon layui-icon-edit"></em>编辑
    </button>
    <button type="button" lay-event="del"  class="layui-btn layui-btn-xs  layui-btn-primary layui-border-red" shiro:hasPermission="baseContractorTeam:delete">
        <em class="layui-icon layui-icon-delete"></em>删除
    </button>
</script>
<script type="text/html" id="status-bar">
    <input type="checkbox" name="teamStatus" value="{{d.status}}" lay-skin="switch" lay-text="启用|禁用"
           lay-filter="teamStatus" lay-event="statusEvent" {{ d.status== '1' ? 'checked' : '' }} />
</script>

<script type="text/html" id="status-bar1">
    <input type="checkbox" name="teamUserStatus" value="{{d.status}}" lay-skin="switch" lay-text="启用|禁用"
           lay-filter="teamUserStatus" lay-event="statusEvent" {{ d.status== '1' ? 'checked' : '' }} />
</script>
</body>
</html>